package com.zhxymm.book.service;

import com.zhxymm.book.dao.UserOneRepository;
import com.zhxymm.book.entity.UserOne;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserOneService {

    @Autowired
    UserOneRepository userOneRepository;

    public
    List<UserOne> getAll(){
        return userOneRepository.findAll();
    }

    public UserOne save(UserOne userOne){
        return userOneRepository.save(userOne);
    }

    public UserOne findByUserId(long theId) {
        return userOneRepository.findByUserId(theId);
    }

    public void delete(UserOne theUserOne) {
        userOneRepository.delete(theUserOne);
    }
}
